<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            background-color: #ccc;
        }
        .bear{position: absolute;
            height: 100px;
            width: 200px;
            background: url(./img/bear.png) no-repeat;
            animation: bear 2s steps(8) infinite,move 2s linear forwards;
        }
        /* 两个动画直接用逗号加在后面. */
        @keyframes bear{
            0%{
                background-position: 0 0;
            }
            100%{
                background-position: -1600px 0;
            }

        }
        @keyframes move{
             0%{
               left: 0;
            }
            100%{
               left: 50%;
               transform: translate(-50%, 0);
            }

        }
    </style>
</head>
<body>
    <div class="bear"></div>
</body>
</html>